function _countCheck(chkName, form) {
	var iCount, nFrom;
	var listDel, listTo;
	iCount = 0;
	frmlen=form.length;
	for (ielement=0;ielement<frmlen;ielement++) {
		ElenameName=form.elements[ielement].name;
		if (ElenameName == chkName && form.elements[ielement].checked) {
			iCount = 1;
			break;
		}

	}
	return iCount;
}
function _checkALL(value, chkName, form) {
	var iCount, nFrom;
	var listDel, listTo;
	iCount = 0;
	frmlen=form.length;
	for (ielement=0;ielement<frmlen;ielement++) {
		ElenameName=form.elements[ielement].name;
		if (ElenameName == chkName)
			form.elements[ielement].checked = value;

	}
}
function _sort(field, form) {
	if (field==form.SortField.value)
	{
		if (form.SortType.value=="ASC")
		{
			form.SortType.value="DESC";
		} else {
			form.SortType.value="ASC";
		}
	} else {
			form.SortType.value="ASC";
	}
	
	form.SortField.value = field;
	form.submit();
}
function _goPage(page, i, form) {
	form.page.value = page + i;
	form.submit();
	return;
}
function _go(form) {
	numGo = form.numGo.value;
	if (numGo > 0 &&  numGo  <= form.pages.value) {
		form.page.value = numGo;
		form.submit();
	}
	return;
}

function _add(page, form) {
	form.action	= page;
	form.submit();
}

function _update(id, page, form) {
	form.action	= page;
	form.txtID.value = id;
	form.submit();
}

function _openOrder(id, page, form) {
	form.action	= page;
	form.txtID.value = id;
	form.submit();
}

function _otherInfo(id, page, form) {
	form.action	= page;
	form.txtID.value = id;
	form.submit();
}

function _delete(id, form) {
	if (confirm("Are you sure you want to delete this record?")) 
	{
		form.act.value = "DELETE";
		form.txtID.value = id;
		form.submit();
		
		return;
	}
	return false;
}

function _inactive(id, form) {
	if (confirm("Are you sure you want to inactive this record?")) 
	{
		form.act.value = "DELETE";
		form.txtID.value = id;
		form.submit();
		
		return;
	}
	return false;
}

function _active(id, form) {
	form.act.value = "ACTIVE";
	form.txtID.value = id;
	form.submit();
	
	return;
}

function _back(page, form) {
	form.action = page;
	form.submit();
}

function _search(form) {
	form.submit();
}
